f2941b
@@ -2195,7 +2195,7 @@
static protected boolean renameFile(HiveConf conf, Path srcf, Path destf, FileSy
         }
       }
       success = fs.rename(srcf, destf);
-      LOG.debug((replace ? "Replacing src:" : "Renaming src:") + srcf.toString()
+      LOG.info((replace ? "Replacing src:" : "Renaming src:") + srcf.toString()
           + ";dest: " + destf.toString()  + ";Status:" + success);
     } catch (IOException ioe) {
       throw new HiveException("Unable to move source" + srcf + " to destination " + destf, ioe);
@@ -2297,10 +2297,7 @@
static protected void replaceFiles(Path srcf, Path destf, Path oldPath, HiveConf
       }
       List<List<Path[]>> result = checkPaths(conf, fs, srcs, destf, true);
 
-      // point of no return -- delete oldPath only if it is not same as destf,
-      // otherwise, the oldPath/destf will be cleaned later just before move
-      if (oldPath != null && (!destf.getFileSystem(conf).equals(oldPath.getFileSystem(conf))
-          || !destf.equals(oldPath))) {
+      if (oldPath != null) {
         try {
           FileSystem fs2 = oldPath.getFileSystem(conf);
           if (fs2.exists(oldPath)) {
@@ -2321,6 +2318,9 @@
static protected void replaceFiles(Path srcf, Path destf, Path oldPath, HiveConf
         Path destfp = destf.getParent();
         if (!fs.exists(destfp)) {
           boolean success = fs.mkdirs(destfp);
+          if (!success) {
+            LOG.warn("Error creating directory " + destf.toString());
+          }
           if (inheritPerms && success) {
             fs.setPermission(destfp, fs.getFileStatus(destfp.getParent()).getPermission());
           }
@@ -2334,6 +2334,9 @@
static protected void replaceFiles(Path srcf, Path destf, Path oldPath, HiveConf
       } else { // srcf is a file or pattern containing wildcards
         if (!fs.exists(destf)) {
           boolean success = fs.mkdirs(destf);
+          if (!success) {
+            LOG.warn("Error creating directory " + destf.toString());
+          }
           if (inheritPerms && success) {
             fs.setPermission(destf, fs.getFileStatus(destf.getParent()).getPermission());
           }
